Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development


lookupComplete event

This event occurs on leave of the lookup (published by the procedure leavelookup in lookup.p) and also on return from the selection of a row in the lookup browse in the procedure rowSelected in lookup.p. lookupComplete has the following parameters:

DEFINE INPUT PARAMETER pcFieldNames         AS CHARACTER    NO-UNDO. 
DEFINE INPUT PARAMETER pcFieldValues        AS CHARACTER    NO-UNDO. 
DEFINE INPUT PARAMETER pcKeyFieldValue      AS CHARACTER    NO-UNDO. 
DEFINE INPUT PARAMETER pcNewScreenValue     AS CHARACTER    NO-UNDO. 
DEFINE INPUT PARAMETER pcOldScreenValue     AS CHARACTER    NO-UNDO. 
DEFINE INPUT PARAMETER plBrowseUsed         AS LOGICAL      NO-UNDO. 
DEFINE INPUT PARAMETER phlookup             AS HANDLE        NO-UNDO. 

Table 1–2 describes the lookupCompleteEvent parameters.

Table 1–2: lookupCompleteEvent parameters
Parameter
Description
pcFieldNames
A comma-delimited list of field names (in the form table.fieldname) that includes the key field, the displayed field, all the selected browse fields, and the selected linked fields, each field appearing only once in the list.
pcFieldValues
A CHR(1)-delimited list of the corresponding values for the fields in pcFieldNames.
pcKeyFieldValue
The key field value of the selected record.
pcNewScreenValue
The currently displayed field SCREEN-VALUE.
pcOldScreenValue
The previously displayed field SCREEN-VALUE before the lookup was done, which can be used to see if the value was changed.
plBrowseUsed
This logical parameter equals TRUE if the new record was selected from the lookup browse, or FALSE if the new record was selected as a result of manually entering a value without using the lookup browse.
phlookup
The handle of the lookup SmartDataField instance, used to determine which lookup on your viewer caused the event to occur (in the case where your viewer contains multiple lookups).

To use this event, simply add a procedure to your viewer’s custom super procedure with the name lookupComplete and the above parameters. Then in initializeObject of your custom super procedure, before the RUN SUPER statement, add the following line:

SUBSCRIBE PROCEDURE TARGET-PROCEDURE TO "lookupComplete":U  
  IN TARGET-PROCEDURE. 

This hook is useful if you must control the updating of related fields to the lookup field whenever a new value is selected. Remember that the linked fields and widgets instance properties of the lookup can be used to automatically update related fields, so this event is only really for exceptional circumstances where perhaps specific formatting is required of the related fields. It might also be necessary to pass new or linked values on to other viewers, in which case this event could also be useful.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095